package com.cygsunri.commonutils.enums;

public enum GridEnum {

    LG_01("01","LG工业园区责任区网格一"),
    LG_02("02","LG工业园区责任区网格二"),
    LG_03("03","LG工业园区责任区网格三");


    private String code;
    private String desc;

    GridEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescFromCode(String code){
        GridEnum[] values = GridEnum.values();
        for (GridEnum value : values) {
            if (value.getCode().equals(code)){
                return value.desc;
            }
        }
        return null;
    }

    public static String getCodeFromDesc(String desc){
        GridEnum[] values = GridEnum.values();
        for (GridEnum value : values) {
            if (value.getDesc().equals(desc)){
                return value.code;
            }
        }
        return null;
    }

}
